<template lang="jade">
div
  h-loader-full(url='loader',:setdata='false')
  h-data-updater
    m-title(icon='add',name='编辑注册介绍')
    table.single
      mf-row(name='标题')
        input(type = 'text',v-model='p.title',placeholder='请填写名称')
      mf-row(name='正文介绍')
        textarea#summary.editor(style='width: 500px; height: 600px;', v-model='p.summary') {{p.summary}}
      mf-row
        button(@click='button') 确认修改
</template>

<script>

export default {
  data () {
    return {
      loader:{
        p:'companyreg/desinfo?id=' + this.$query.get('id'),
      },
      p:{},
    }
  },
  mounted (){ 
  },
  watch:{
  },
  methods: {
    loadAfter(res){
      this.p = res.p;
      summary.sync();
      summary.html(this.p.content);
    },
    button(){
      summary.sync()
      this.p.content = this.$dom.id('summary').value
      this.$ajax.put('update/companyregdes',this.p,(res)=>{
        this.$msg.success(res.message)
        setTimeout("window.location.reload()",1000)
      },(res)=>{
        this.$msg.error(res.message)
      })

    }
  }
}
</script>